MarRiskControl
MarRiskControl records are used to establish risk controls within SpiderRock execution engines. These records are only viewable and editable by users belonging to the same riskFirm as the control records.
METADATA
| Attribute | Value |
|---|---|
| Topic | 4535-risk-control |
| MLink Token | MARRisk |
| Product | SRControl |
| accessType | SELECT,UPDATE,INSERT,DELETE |
| MLink Endpoint | MLink-Live |
Table Definition
| Field | Type | Key | Default Value | Comment |
|---|---|---|---|---|
| riskFirm | VARCHAR(16) | PRI | '' | If exists a client firm imposing risk controls should be an existing SR client ID |
| riskGroup | VARCHAR(16) | PRI | '' | The ID of the risk group these rules will apply to |
| isTestAccnt | enum - YesNo | PRI | 'None' | If Yes this control applies only to risk for test accounts |
| riskLevel | enum - MarRiskLevel | PRI | 'None' | AccountConfig risk level this control binds to None legacy prelevel record lookups prefer an exact level match and fall back to None new records must set a real level |
| stkEnabled | enum - MarState | 'None' | Enabled or not for equities Nonedisabled | |
| optEnabled | enum - MarState | 'None' | Enabled or not for options Nonedisabled | |
| futEnabled | enum - MarState | 'None' | Enabled or not for futures Nonedisabled required Enable on every risk level | |
| futOptEnabled | enum - MarState | 'None' | Enabled or not for futures options Nonedisabled required Enable on every risk level | |
| marginLimitAcc | FLOAT | 0 | Maximum net per symbol total portfolio startofday positions day trades margin can include external sources | |
| marginLimitDay | FLOAT | 0 | Maximum net per symbolday day portfolio day trades only margin can include external sources | |
| openExposureLimit | FLOAT | 0 | Maximum abs open child order Delta no netting open child orders only | |
| orderMaxStkQty | INT | 0 | Number of equity shares that can be bought or sold by a single parent order Has a maximum value of 10M | |
| orderMaxOptQty | INT | 0 | Number of option contracts that can be bought or sold by a single parent order | |
| orderMaxStkDDelta | FLOAT | 0 | Maximum abs mny per stock parent order ddelta shares pointValue midPrc | |
| orderMaxOptDDelta | FLOAT | 0 | Maximum abs mny per option parent order ddelta contracts pointValue ABSde uMidPrc | |
| stkCollarPct | FLOAT | 0 | Maximum user limit vs bidask price control percentage as a number between 0 and 1 in decimals | |
| optCollarPct | FLOAT | 0 | Maximum user limit vs bidask price control percentage as a number between 0 and 1 in decimals | |
| allowStkOddLots | enum - YesNo | 'None' | Allow parent stock orders with an order size below 100 | |
| allowLimitOnClose | enum - YesNo | 'None' | Allow limit on close orders similar to MOC order with the addition of a price limit | |
| allowMarketOnClose | enum - YesNo | 'None' | Allow market on close orders special order type which is executed as close to the close of trading as possible | |
| allowInterMarketSweep | enum - YesNo | 'None' | Allow intermarket sweep orders | |
| blockShortSales | enum - YesNo | 'None' | Block all short sales | |
| modifiedBy | VARCHAR(24) | '' | User that last modified this record | |
| modifiedIn | enum - SysEnvironment | 'None' | Environment this record was last updated in | |
| timestamp | DATETIME(6) | '1900-01-01 00:00:00.000000' | Timestamp of this record |
PRIMARY KEY DEFINITION (Unique)
| Field | Sequence |
|---|---|
| riskFirm | 1 |
| riskGroup | 2 |
| isTestAccnt | 3 |
| riskLevel | 4 |
SELECT TABLE EXAMPLE QUERY
SELECT *
FROM `SRControl`.`MsgMarRiskControl`
WHERE
/* Replace with a VARCHAR(16) */
`riskFirm` = 'Example_riskFirm'
AND
/* Replace with a VARCHAR(16) */
`riskGroup` = 'Example_riskGroup'
AND
/* Replace with a ENUM('None','Yes','No') */
`isTestAccnt` = 'None'
AND
/* Replace with a ENUM('None','ExsOnSpons','ExsOnCore','SponsOnCore','CoreOnCore','CoreOnSub','CoreOnAccnt','SubOnAccnt','CoreOnCustom','SubOnCustom','CFirmOnCore') */
`riskLevel` = 'None';
UPDATE TABLE EXAMPLE QUERY
UPDATE `SRControl`.`MsgMarRiskControl`
SET
/* Replace with a ENUM('None','Enable','Disabled','CloseOnly') */
`stkEnabled` = 'None',
/* Replace with a ENUM('None','Enable','Disabled','CloseOnly') */
`optEnabled` = 'None',
/* Replace with a ENUM('None','Enable','Disabled','CloseOnly') */
`futEnabled` = 'None',
/* Replace with a ENUM('None','Enable','Disabled','CloseOnly') */
`futOptEnabled` = 'None',
/* Replace with a FLOAT */
`marginLimitAcc` = 1.23,
/* Replace with a FLOAT */
`marginLimitDay` = 1.23,
/* Replace with a FLOAT */
`openExposureLimit` = 1.23,
/* Replace with a INT */
`orderMaxStkQty` = 5,
/* Replace with a INT */
`orderMaxOptQty` = 5,
/* Replace with a FLOAT */
`orderMaxStkDDelta` = 1.23,
/* Replace with a FLOAT */
`orderMaxOptDDelta` = 1.23,
/* Replace with a FLOAT */
`stkCollarPct` = 1.23,
/* Replace with a FLOAT */
`optCollarPct` = 1.23,
/* Replace with a ENUM('None','Yes','No') */
`allowStkOddLots` = 'None',
/* Replace with a ENUM('None','Yes','No') */
`allowLimitOnClose` = 'None',
/* Replace with a ENUM('None','Yes','No') */
`allowMarketOnClose` = 'None',
/* Replace with a ENUM('None','Yes','No') */
`allowInterMarketSweep` = 'None',
/* Replace with a ENUM('None','Yes','No') */
`blockShortSales` = 'None',
/* Replace with a DATETIME(6) */
`timestamp` = '2022-01-01 12:34:56.000000'
WHERE
/* Replace with a VARCHAR(16) */
`riskFirm` = 'Example_riskFirm'
AND
/* Replace with a VARCHAR(16) */
`riskGroup` = 'Example_riskGroup'
AND
/* Replace with a ENUM('None','Yes','No') */
`isTestAccnt` = 'None'
AND
/* Replace with a ENUM('None','ExsOnSpons','ExsOnCore','SponsOnCore','CoreOnCore','CoreOnSub','CoreOnAccnt','SubOnAccnt','CoreOnCustom','SubOnCustom','CFirmOnCore') */
`riskLevel` = 'None';
INSERT TABLE EXAMPLE QUERY
INSERT INTO `SRControl`.`MsgMarRiskControl`(
/* Replace with a VARCHAR(16) */
`riskFirm`,
/* Replace with a VARCHAR(16) */
`riskGroup`,
/* Replace with a ENUM('None','Yes','No') */
`isTestAccnt`,
/* Replace with a ENUM('None','ExsOnSpons','ExsOnCore','SponsOnCore','CoreOnCore','CoreOnSub','CoreOnAccnt','SubOnAccnt','CoreOnCustom','SubOnCustom','CFirmOnCore') */
`riskLevel`,
/* Replace with a ENUM('None','Enable','Disabled','CloseOnly') */
`stkEnabled`,
/* Replace with a ENUM('None','Enable','Disabled','CloseOnly') */
`optEnabled`,
/* Replace with a ENUM('None','Enable','Disabled','CloseOnly') */
`futEnabled`,
/* Replace with a ENUM('None','Enable','Disabled','CloseOnly') */
`futOptEnabled`,
/* Replace with a FLOAT */
`marginLimitAcc`,
/* Replace with a FLOAT */
`marginLimitDay`,
/* Replace with a FLOAT */
`openExposureLimit`,
/* Replace with a INT */
`orderMaxStkQty`,
/* Replace with a INT */
`orderMaxOptQty`,
/* Replace with a FLOAT */
`orderMaxStkDDelta`,
/* Replace with a FLOAT */
`orderMaxOptDDelta`,
/* Replace with a FLOAT */
`stkCollarPct`,
/* Replace with a FLOAT */
`optCollarPct`,
/* Replace with a ENUM('None','Yes','No') */
`allowStkOddLots`,
/* Replace with a ENUM('None','Yes','No') */
`allowLimitOnClose`,
/* Replace with a ENUM('None','Yes','No') */
`allowMarketOnClose`,
/* Replace with a ENUM('None','Yes','No') */
`allowInterMarketSweep`,
/* Replace with a ENUM('None','Yes','No') */
`blockShortSales`,
/* Replace with a DATETIME(6) */
`timestamp`
)
VALUES(
'Example_riskFirm',
'Example_riskGroup',
'None',
'None',
'None',
'None',
'None',
'None',
1.23,
1.23,
1.23,
5,
5,
1.23,
1.23,
1.23,
1.23,
'None',
'None',
'None',
'None',
'None',
'2022-01-01 12:34:56.000000'
);
DELETE TABLE EXAMPLE QUERY
DELETE FROM `SRControl`.`MsgMarRiskControl`
WHERE
/* Replace with a VARCHAR(16) */
`riskFirm` = 'Example_riskFirm'
AND
/* Replace with a VARCHAR(16) */
`riskGroup` = 'Example_riskGroup'
AND
/* Replace with a ENUM('None','Yes','No') */
`isTestAccnt` = 'None'
AND
/* Replace with a ENUM('None','ExsOnSpons','ExsOnCore','SponsOnCore','CoreOnCore','CoreOnSub','CoreOnAccnt','SubOnAccnt','CoreOnCustom','SubOnCustom','CFirmOnCore') */
`riskLevel` = 'None';
Doc Columns Query
SELECT * FROM SRControl.doccolumns WHERE TABLE_NAME='MarRiskControl' ORDER BY ordinal_position ASC;